package cn.twh.wall;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

@SpringBootApplication
@EnableDiscoveryClient
@Slf4j
public class ServerStart {

    public static void main(String[] args) {
        try {
            SpringApplication.run(ServerStart.class, args);
            // 可以尝试增加钩子，在jvm停止时执行指定线程方法
            Runtime.getRuntime().addShutdownHook(new Thread(() -> System.out.println("ShutDown hook")));
        } catch (Exception e) {
            log.info("START ERROR");
            return;
        }
        log.info("START OK");
    }
}
